﻿using System;
using System.Configuration;

namespace WeiSha.Core.Method
{
	// Token: 0x0200003C RID: 60
	public class Domain
	{
		// Token: 0x06000289 RID: 649 RVA: 0x00011662 File Offset: 0x0000F862
		public Domain()
		{
			this._currtentDomain = Server.Domain;
		}

		// Token: 0x0600028A RID: 650 RVA: 0x0001167E File Offset: 0x0000F87E
		public Domain(string current)
		{
			this._currtentDomain = current;
		}

		// Token: 0x170000FE RID: 254
		// (get) Token: 0x0600028B RID: 651 RVA: 0x00011698 File Offset: 0x0000F898
		public string CurrtentDomain
		{
			get
			{
				return this._currtentDomain;
			}
		}

		// Token: 0x170000FF RID: 255
		// (get) Token: 0x0600028C RID: 652 RVA: 0x000116B0 File Offset: 0x0000F8B0
		public string TwoDomain
		{
			get
			{
				bool flag = this._currtentDomain.IndexOf(".") < 0;
				string text;
				if (flag)
				{
					text = this._currtentDomain;
				}
				else
				{
					bool flag2 = this._currtentDomain.Length <= this.MainName.Length;
					if (flag2)
					{
						text = this._currtentDomain;
					}
					else
					{
						string text2 = this._currtentDomain.Substring(this._currtentDomain.Length - this.MainName.Length);
						bool flag3 = text2 != this.MainName;
						if (flag3)
						{
							text = this._currtentDomain;
						}
						else
						{
							text2 = this._currtentDomain.Substring(0, this._currtentDomain.Length - this.MainName.Length - 1);
							bool flag4 = text2.IndexOf(".") < 0;
							if (flag4)
							{
								text = text2;
							}
							else
							{
								text2 = text2.Substring(text2.LastIndexOf(".") + 1);
								text = text2;
							}
						}
					}
				}
				return text;
			}
		}

		// Token: 0x17000100 RID: 256
		// (get) Token: 0x0600028D RID: 653 RVA: 0x000117A4 File Offset: 0x0000F9A4
		public string MainName
		{
			get
			{
				ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings[ConfigurationManager.ConnectionStrings.Count - 1];
				return connectionStringSettings.Name;
			}
		}

		// Token: 0x040000C3 RID: 195
		private string _currtentDomain = null;
	}
}
